package com.cictec.middleware.tde.rm.protocol;

import java.nio.ByteBuffer;

/**
 * 抽象消息编码器，根据具体消息类型实现encode方法，详细参见 各协议com.cictec.middleware.terminal.codec.*.encode包实现
 * @author Administrator
 *
 */
public abstract class AbstractMessageEncoder implements MessageEncoder {

	protected byte[] toBytes(ByteBuffer bb) {
		byte[] bytes = new byte[bb.position()];
		bb.flip();

		bb.get(bytes);
		return bytes;
	}
}
